package com.gaber.enums;

import java.util.LinkedList;
import java.util.Map;

/**
 * @author gaber
 * @date 2023/7/11 17:54:23
 * @description 主函数
 */
public class Test {

    public static void main(String[] args) {
        Color c = Color.RED;
        System.out.println(c);
        c.colorInfo();


        //遍历枚举
        for (Color myVar : Color.values()) {
            System.out.println(myVar);
        }
        //枚举类常应用于 switch 语句中
        Color myVar = Color.BLUE;
        switch(myVar) {
            case RED:
                System.out.println("红色");
                break;
            case GREEN:
                System.out.println("绿色");
                break;
            case BLUE:
                System.out.println("蓝色");
                break;
        }
    }
}
